import request from "./request";
import qs from "qs";
// 精品数据
export const JingPinApi = () => request.get("/products/recommend")

export const SendSMSApi = (params) => request.post("/sendSMS", qs.stringify(params))

export const PhoneReginApi = (params) => request.post("/phoneRegin", qs.stringify(params))

//  微信扫码登录 /wechatUsers/PCLogin
export const PCLoginApi = (params) => request.post("/wechatUsers/PCLogin", qs.stringify(params))

// 微信绑定
export const WeiXinBindApi = (params) => request.post("/wechatUsers/binding", qs.stringify(params))

// 用户信息
export const UserInfoApi = () => request.get("/shop/userProfiles")

// 热门数据
export const RemenApi = () => request.get("/products/hot")

// 商品详情     详情页调用发请求要传 id，所以封装api这里也要形参接收 id 以及把 id 加到发请求的域名里去
export const DetalisApi = (id) => request.get(`/products/${id}`)

// 加入购物车
export const AddCartApi = (params) => request.post("/shop/carts/add", qs.stringify(params))

// 更多
export const ProductsApi = () => request.get("/products")
